﻿using System.Web.UI;

namespace Jaws.Core.Web.Controls
{
    /// <summary>
    /// Summary description for UserControlBase
    /// </summary>
    public abstract class WebPartControlBase<M> : UserControl, System.Web.UI.WebControls.WebParts.IWebPart where M : class
    {
        
        public M BaseMasterPage
        {
            get { return (Page.Master as M); }
        }

        #region Implementation of IWebPart

        /// <summary>
        /// Gets or sets the URL to an image that represents a <see cref="T:System.Web.UI.WebControls.WebParts.WebPart" /> control in a catalog of controls.
        /// </summary>
        /// <returns>
        /// A string that represents the URL to an image used to represent the control in a catalog. The default value is an empty string ("").
        /// </returns>
        public string CatalogIconImageUrl { get; set; }

        /// <summary>
        /// Gets or sets a brief phrase that summarizes what a control does, for use in ToolTips and catalogs of <see cref="T:System.Web.UI.WebControls.WebParts.WebPart" /> controls.
        /// </summary>
        /// <returns>
        /// A string that briefly summarizes the control's functionality. The default value is an empty string ("").
        /// </returns>
        public string Description { get; set; }

        /// <summary>
        /// Gets a string that is concatenated with the <see cref="P:System.Web.UI.WebControls.WebParts.IWebPart.Title" /> property value to form a complete title for a <see cref="T:System.Web.UI.WebControls.WebParts.WebPart" /> control.
        /// </summary>
        /// <returns>
        /// A string that serves as a subtitle for the control. The default value is an empty string ("").
        /// </returns>
        public string Subtitle { get; private set; }

        /// <summary>
        /// Gets or sets the title of a <see cref="T:System.Web.UI.WebControls.WebParts.WebPart" /> control.
        /// </summary>
        /// <returns>
        /// A string that contains the title of the control. The default value is an empty string ("").
        /// </returns>
        public string Title { get; set; }

        /// <summary>
        /// Gets or sets the URL to an image used to represent a Web Parts control in the control's own title bar.
        /// </summary>
        /// <returns>
        /// A string that represents the URL to an image. The default value is an empty string ("").
        /// </returns>
        public string TitleIconImageUrl { get; set; }

        /// <summary>
        /// Gets or sets a URL to supplemental information about a <see cref="T:System.Web.UI.WebControls.WebParts.WebPart" /> control.
        /// </summary>
        /// <returns>
        /// A string that represents a URL to more information about a <see cref="T:System.Web.UI.WebControls.WebParts.WebPart" /> control. The default value is an empty string ("").
        /// </returns>
        public string TitleUrl { get; set; }

        #endregion
    }
}